<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
    <style>
        .container {
            width: 1000px;
            height: 300px;
            background-color: #ccc;
            overflow: hidden;
            margin: 0 auto;
            display: flex;
            align-items: center;
        }
        .container > div {
            border-radius: 50%;
            border: 1px solid #fff;     
            background-color: rgba(0,0,255,1);
            flex-shrink: 0;
            box-sizing: border-box;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- <div style="width:40px;height:40px; opacity: 1;"></div> -->
    </div>

    <script>
        function App() {
            this.w = 40 ;
            this.h = 40 ;
            this.a = 1;
            this.ele = document.querySelector(".container");
        }

        App.prototype.createCircle = function () {
            var divCreate = document.createElement("div");
            divCreate.style["width"] = this.w + "px";
            divCreate.style["height"] = this.h + "px";
            divCreate.style["opacity"] = this.a ;
            this.ele.appendChild(divCreate);

            this.w = this.w + 10 ;
            this.h = this.h + 10 ;
            this.a = (this.a * 100 - 0.08 * 100) / 100;
        }

        var res = new App();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
        res.createCircle();
    </script>
</body>
</html>